home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / portable / baudrate.c next >
C/C++ Source or Header  |  1993-06-18  |  2KB  |  65 lines

  1. #include <limits.h>
  2. #define CURSES_LIBRARY    1
  3. #include <curses.h>
  4. #ifdef UNIX
  5. #include <defs.h>
  6. #include <term.h>
  7. #endif
  8. #undef baudrate
  9.  
  10. #ifdef PDCDEBUG
  11. char *rcsid_baudrate = "$Header: C:\CURSES\portable\RCS\baudrate.c 2.1 1993/06/18 20:19:31 MH Rel MH $";
  12. #endif
  13.  
  14.  
  15.  
  16.  
  17. /*man-start*********************************************************************
  18.  
  19.   baudrate()    - Return terminal baud rate
  20.  
  21.   X/Open Description:
  22.      Returns the output speed of the terminal.  The number returned
  23.      is bits per second, for example 9600, and is an integer.
  24.  
  25.   PDCurses Description:
  26.      If FAST_VIDEO is true, then this is the largest possible
  27.      (portable) int value (INT_MAX from limits.h) IF direct
  28.      video is possible, OR the approximate guess at BIOS speeds,
  29.      19200.
  30.  
  31.      If FAST_VIDEO is false, this is an approximate guess at BIOS
  32.      speeds, 19200.
  33.  
  34.   X/Open Return Value:
  35.      The baudrate() function returns a pointer to a verbose description
  36.      of the current terminal on success and the null pointer on error.
  37.  
  38.   X/Open Errors:
  39.      No errors are defined for this function.
  40.  
  41.   Portability:
  42.      PDCurses        int baudrate( void );
  43.      X/Open Dec '88        int baudrate( void );
  44.      BSD Curses
  45.      SYS V Curses
  46.  
  47. **man-end**********************************************************************/
  48.  
  49. int    baudrate(void)
  50. {
  51. #ifdef PDCDEBUG
  52.     if (trace_on) PDC_debug("baudrate() - called\n");
  53. #endif
  54.  
  55. #ifdef UNIX
  56.     return (_CUR_TERM.baudrate);
  57. #else
  58. #ifdef FAST_VIDEO
  59.     return (_cursvar.direct_video ? INT_MAX : 19200 );
  60. #else
  61.     return (19200);            /* Approx. guess at BIOS speeds.*/
  62. #endif
  63. #endif
  64. }
  65.